package com.glsc.ngateway.common.base.domain.mysql.flowable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@Table(name = "t_flowable_comment_supplement")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class FlowableCommentSupplement {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "varchar(20) COMMENT '唯一编码'")
    private Integer id;

    @Column(name = "process_id", columnDefinition = "varchar(50) COMMENT '流程id'")
    private String processId;

//    @Column(name = "process_title", columnDefinition = "varchar(200) COMMENT '流程标题'")
//    private String processTitle;

    @Column(name = "task_id", columnDefinition = "varchar(50) COMMENT '任务id'")
    private String taskId;

    @Column(name = "task_name", columnDefinition = "varchar(200) COMMENT '任务名称'")
    private String taskName;

    @Column(name = "comment", columnDefinition = "varchar(500) COMMENT '任务名称'")
    private String comment;

    @Column(name = "task_assignee", columnDefinition = "varchar(200) COMMENT '任务名称'")
    private String taskAssignee;

    @Column(name = "handle_status", columnDefinition = "varchar(20) COMMENT '任务处理状态:已查看,未查看,已签字'")
    private String taskHandleStatus;

    @Column(name = "create_time", updatable = false, columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @Column(name = "op_time", columnDefinition = "datetime comment '操作时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
    @ApiModelProperty(value = "创建时间")
    private Date opTime;
}
